package com.itheima.mapper.backend;


import com.itheima.pojo.backend.Dish;
import com.itheima.pojo.backend.Flavor;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface DishDao {


    /**
     * 分页查询
     */
    List<Dish> select(String name);


    /**
     * 按id查询
     * @param id
     * @return
     */
    Dish selectByid(String id);


    /**
     *
     * @param categoryId
     * @return
     */
    List<Dish> dishlist(@Param("categoryId") String categoryId);



    /**
     * 添加
     * @param dish
     * @return
     */
    int add(Dish dish);

    void flavorAdd(Flavor flavor);

    /**
     * 修改
     * @param dish
     * @return
     */
    int updatDish(Dish dish);

    void updateF(Flavor flavor);

    /**删除
     *
     * @param id
     * @return
     */
    int  deleteDish(String id);

    /**
     * 修改状态
     * @param id
     * @param status
     * @return
     */
    int status(String id,Integer status);

   List<Dish>  dishList(String categoryId, Integer status);

   Dish statusDishName(String name);



}
